<template>
    <div>
        <el-row type="flex" class="editformitem" align="middle">
            <el-col :span="8" class="editlabel">
                <span>点击跳转</span>
            </el-col>
            <el-col :span="16" class="editcontent">
                <el-radio v-model="obj.contactType" :label="1">看板</el-radio>
                <el-radio v-model="obj.contactType" :label="2">网址</el-radio>
            </el-col>
        </el-row>
        <el-row type="flex" class="editformitem" align="middle" v-if="obj.contactType == 2">
            <el-col :span="8" class="editlabel">
                <span></span>
            </el-col>
            <el-col :span="16" class="editcontent">
                <!-- <input v-model="obj.url" type="text" /> -->
                <el-input type="textarea" v-model="obj.url" :autosize="{ minRows: 4 }"></el-input>
            </el-col>
        </el-row>
        <el-row type="flex" class="editformitem" align="middle" v-if="obj.contactType == 1">
            <el-col :span="8" class="editlabel">
                <span></span>
            </el-col>
            <el-col :span="16" class="editcontent">
                <select v-model="obj.boardId">
                    <option value="">请选择</option>
                    <option :value="item.id" v-for="item in boardListArr" :key="item.id">
                        {{ item.name }}
                    </option>
                </select>
            </el-col>
        </el-row>
    </div>
</template>

<script>
// import { allList } from "@/api/board";

export default {
    name: "EventForm",
    props: {
        obj: Object
    },
    model: {
        prop: "obj",
        event: "change",
    },
    data() {
        return {
            boardListArr: [],
        }
    },
    created() {
        this.getBoardList();
    },
    methods: {
        getBoardList() {
            allList({
                pageInfo: {
                    pageSize: 999,
                    page: 1,
                    totalCount: 0,
                },
                orderBy: "createTime",
                orderAsc: false,
                name: "",
            }).then((response) => {
                if (response.data.code == 0) {
                    this.boardListArr = response.data.data.data;
                }
            }).catch(() => { });
        },
    }
}
</script>